﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterSGA.Master" AutoEventWireup="true" CodeBehind="CollectionManager.aspx.cs" Inherits="SGA.Charges.CollectionManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <h2>Gestão de dados de cobrança</h2>

    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </ajaxToolkit:ToolkitScriptManager>

    <div id="leftcolumnwrap">
        <div id="leftcolumn">
            <%-- <p>
                <input type="reset" value="Anular Alterações" class="buttonContext" />
            </p>--%>
            <p>
                <asp:Button ID="SaveBtn" runat="server" Text="Gravar" />
            </p>
            <p>
                <asp:Button ID="SepaFileBtn" runat="server" Text="" CssClass="buttonContext" />
            </p>
            <p>
                <asp:Button ID="ReceiptsBtn" runat="server" Text="" CssClass="buttonContext" />
            </p>
        </div>
    </div>

    <%-- Data sources--%>
    <asp:EntityDataSource ID="EDSCollectionBanks" runat="server" ConnectionString="name=MailingEntities" DefaultContainerName="MailingEntities" EnableFlattening="False" EntitySetName="CollectionBanks" EnableDelete="True" EnableInsert="True" EnableUpdate="True">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="EDSCollectonRanges" runat="server" ConnectionString="name=MailingEntities" DefaultContainerName="MailingEntities" EnableFlattening="False" EntitySetName="CollectionRanges" EnableDelete="True" EnableInsert="True" EnableUpdate="True" OrderBy="it.CollectionDay">
    </asp:EntityDataSource>
    <%-- Fim Data sources--%>

    <div class="InLine">
        <div id="Notifications">
            <asp:Label ID="NotificationLabel" runat="server" BackColor="Red" BorderColor="Black" Font-Bold="True" ForeColor="White" Width="1000px"></asp:Label>
        </div>

        <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" Height="494px" Width="890px">
            <ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="Bancos de cobrança">
                <ContentTemplate>
                    <p>
                        Gestão dos bancos de cobrança
                    </p>
                    <%--<div class="InLine">
                        <asp:Label ID="NameBankLbl" runat="server" Text="Nome" CssClass="LeftAlignLabel"></asp:Label>
                        <br />
                        <asp:TextBox ID="NameBankTbox" runat="server" Columns="80"></asp:TextBox>
                    </div>
                    <div class="InLine">
                        <asp:Label ID="IBANLbl" runat="server" Text="IBAN" CssClass="LeftAlignLabel"></asp:Label>
                        <br />
                        <asp:TextBox ID="IBANTbox" runat="server" Columns="50"></asp:TextBox>
                    </div>
                    <div>
                        <asp:CheckBox ID="IsActiveBankChkBox" runat="server" Text="Mostrar este banco nas opções de cobrança" Checked="True" />
                    </div>
                    <div>
                        <asp:CheckBox ID="IsDefaultBankChkBox" runat="server" Text="Definir este banco como banco padrão de cobrança" Checked="True" />
                    </div>--%>

                    <div>
                        <asp:ListView ID="CollectionBanksLvw" runat="server" DataSourceID="EDSCollectionBanks" DataKeyNames="Id" InsertItemPosition="FirstItem">
                            <AlternatingItemTemplate>
                                <tr style="background-color: #FFF8DC;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="DesignationLabel" runat="server" Text='<%# Eval("Designation") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="IBANLabel" runat="server" Text='<%# Eval("IBAN") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsDefaultCheckBox" runat="server" Checked='<%# Eval("IsDefault") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                    </td>
                                </tr>
                            </AlternatingItemTemplate>
                            <EditItemTemplate>
                                <tr style="background-color: #008A8C; color: #FFFFFF;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:TextBox ID="DesignationTextBox" runat="server" Text='<%# Bind("Designation") %>' Width="350" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="IBANTextBox" runat="server" Text='<%# Bind("IBAN") %>' Width="250" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Bind("IsActive") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsDefaultCheckBox" runat="server" Checked='<%# Bind("IsDefault") %>' />
                                    </td>
                                    <td>
                                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                                    </td>
                                </tr>
                            </EditItemTemplate>
                            <EmptyDataTemplate>
                                <table id="Table1" runat="server" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;">
                                    <tr>
                                        <td>No data was returned.</td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                            <InsertItemTemplate>
                                <tr style="">
                                    <%--<td>
                                        <asp:TextBox ID="IdTextBox" runat="server" Text='<%# Bind("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:TextBox ID="DesignationTextBox" runat="server" Text='<%# Bind("Designation") %>' Width="350" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="IBANTextBox" runat="server" Text='<%# Bind("IBAN") %>' Width="250" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Bind("IsActive") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsDefaultCheckBox" runat="server" Checked='<%# Bind("IsDefault") %>' />
                                    </td>
                                    <td>
                                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                                        <%--<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />--%>
                                    </td>
                                </tr>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <tr style="background-color: #DCDCDC; color: #000000;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="DesignationLabel" runat="server" Text='<%# Eval("Designation") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="IBANLabel" runat="server" Text='<%# Eval("IBAN") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsDefaultCheckBox" runat="server" Checked='<%# Eval("IsDefault") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <LayoutTemplate>
                                <table id="Table2" runat="server">
                                    <tr id="Tr1" runat="server">
                                        <td id="Td1" runat="server">
                                            <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                <tr id="Tr2" runat="server" style="background-color: #DCDCDC; color: #000000;">
                                                    <%--<th id="Th1" runat="server"></th>--%>
                                                    <%--<th id="Th2" runat="server">Id</th>--%>
                                                    <th id="Th3" runat="server">Nome do banco</th>
                                                    <th id="Th4" runat="server">IBAN</th>
                                                    <th id="Th5" runat="server">Activo</th>
                                                    <th id="Th6" runat="server">Padrão</th>
                                                    <th id="Th7" runat="server">Acção</th>
                                                </tr>
                                                <tr id="itemPlaceholder" runat="server">
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr id="Tr3" runat="server">
                                        <td id="Td2" runat="server" style="text-align: center; background-color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000;">
                                            <asp:DataPager ID="DataPager1" runat="server" PageSize="7">
                                                <Fields>
                                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                                    <asp:NumericPagerField />
                                                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                                </Fields>
                                            </asp:DataPager>
                                        </td>
                                    </tr>
                                </table>
                            </LayoutTemplate>
                            <SelectedItemTemplate>
                                <tr style="background-color: #008A8C; font-weight: bold; color: #FFFFFF;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="DesignationLabel" runat="server" Text='<%# Eval("Designation") %>' Width="350" />
                                    </td>
                                    <td>
                                        <asp:Label ID="IBANLabel" runat="server" Text='<%# Eval("IBAN") %>' Width="250" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsDefaultCheckBox" runat="server" Checked='<%# Eval("IsDefault") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                    </td>
                                </tr>
                            </SelectedItemTemplate>
                        </asp:ListView>
                        <p>
                            Activo: Mostra o banco nas opções de cobrança
                            <br />
                            Padrão: Define o banco que vai aparecer seleccionado nas opções de cobrança
                        </p>
                    </div>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Faixas de cobrança">
                <ContentTemplate>
                    <p>
                        Gestão das datas de cobrança
                    </p>
                    <div id="RangeCollectionDiv">



                        <asp:ListView ID="CollectionRangeLvw" runat="server" DataKeyNames="Id" DataSourceID="EDSCollectonRanges" InsertItemPosition="FirstItem">
                            <AlternatingItemTemplate>
                                <tr style="background-color: #FFF8DC;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="CollectionDayLabel" runat="server" Text='<%# Eval("CollectionDay") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                    </td>
                                </tr>
                            </AlternatingItemTemplate>
                            <EditItemTemplate>
                                <tr style="background-color: #008A8C; color: #FFFFFF;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:TextBox ID="CollectionDayTextBox" runat="server" Text='<%# Bind("CollectionDay") %>' Width="50" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Bind("IsActive") %>' />
                                    </td>
                                    <td>
                                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                                    </td>
                                </tr>
                            </EditItemTemplate>
                            <EmptyDataTemplate>
                                <table runat="server" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;">
                                    <tr>
                                        <td>No data was returned.</td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                            <InsertItemTemplate>
                                <tr style="">
                                    <%-- <td>
                                        <asp:TextBox ID="IdTextBox" runat="server" Text='<%# Bind("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:TextBox ID="CollectionDayTextBox" runat="server" Text='<%# Bind("CollectionDay") %>' Width="50" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Bind("IsActive") %>' />
                                    </td>
                                    <td>
                                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                                        <%-- <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />--%>
                                    </td>
                                </tr>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <tr style="background-color: #DCDCDC; color: #000000;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="CollectionDayLabel" runat="server" Text='<%# Eval("CollectionDay") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <LayoutTemplate>
                                <table runat="server">
                                    <tr runat="server">
                                        <td runat="server">
                                            <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                <tr runat="server" style="background-color: #DCDCDC; color: #000000;">
                                                    <%--<th runat="server"></th>
                                                    <th runat="server">Id</th>--%>
                                                    <th runat="server">Dia</th>
                                                    <th runat="server">Activo</th>
                                                    <th runat="server">Acção</th>
                                                </tr>
                                                <tr id="itemPlaceholder" runat="server">
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr runat="server">
                                        <td runat="server" style="text-align: center; background-color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000;">
                                            <asp:DataPager ID="DataPager1" runat="server" PageSize="7">
                                                <Fields>
                                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                                    <asp:NumericPagerField />
                                                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                                </Fields>
                                            </asp:DataPager>
                                        </td>
                                    </tr>
                                </table>
                            </LayoutTemplate>
                            <SelectedItemTemplate>
                                <tr style="background-color: #008A8C; font-weight: bold; color: #FFFFFF;">
                                    <%--<td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                                    </td>--%>
                                    <td>
                                        <asp:Label ID="CollectionDayLabel" runat="server" Text='<%# Eval("CollectionDay") %>' />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                                    </td>
                                </tr>
                            </SelectedItemTemplate>

                        </asp:ListView>
                        <p>
                            Activo: Mostra a data nas faixas de cobrança
                        </p>
                    </div>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
        </ajaxToolkit:TabContainer>


    </div>

</asp:Content>
